package com.cwj.mansysback.entity;

import java.util.List;

public class Student extends Account{

    private static final Integer RANK = 3;

   private String sname;

   private Boolean ssex;

   private Integer sage;

   private Integer sumCredit;

   private List<Teacher> teachers;

   private List<Course> courses;

    public static Integer getRANK() {
        return RANK;
    }

    public List<Teacher> getTeachers() {
        return teachers;
    }

    public void setTeachers(List<Teacher> teachers) {
        this.teachers = teachers;
    }

    public List<Course> getCourses() {
        return courses;
    }

    public void setCourses(List<Course> courses) {
        this.courses = courses;
    }

    public Student() {
    }

    public Student( String sname, Boolean ssex, Integer sage) {
//        this.sid = sid;
        this.sname = sname;
        this.ssex = ssex;
        this.sage = sage;
    }

    public Student(String aid, String password, Integer accrank, String sname, Boolean ssex, Integer sage) {
        super(aid, password, Student.RANK);
        this.sname = sname;
        this.ssex = ssex;
        this.sage = sage;
    }

    public String getSname() {
        return sname;
    }

    public void setSname(String sname) {
        this.sname = sname;
    }

    public Boolean getSsex() {
        return ssex;
    }

    public void setSsex(Boolean ssex) {
        this.ssex = ssex;
    }

    public Integer getSage() {
        return sage;
    }

    public void setSage(Integer sage) {
        this.sage = sage;
    }

//    为了保证其基本永远是2，即学生级别
    @Override
    public void setAccrank(Integer accrank) {
        super.setAccrank(Student.RANK);
    }

    public Integer getSumCredit() {
        return sumCredit;
    }

    public void setSumCredit(java.math.BigDecimal sum){
        this.setSumCredit(sum.intValue());
    }

    public void setSumCredit(Integer sumCredit) {
        this.sumCredit = sumCredit;
    }

    @Override
    public String toString() {
        return super.toString()+"Student{" +
                "sname='" + sname + '\'' +
                ", ssex=" + ssex +
                ", sage=" + sage +
                '}';
    }
}
